<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="../common/taglibs.jsp" %>

<!DOCTYPE html>
<html lang="cn">
<head>
<title>Demo Version</title>
<%@ include file="../common/jqGridScript.jsp" %>
<script type="text/javascript">
$( function() {

	var options = {
	 	url: '${ctx }/demo/demo-version.action',
	 	caption: 'demo version',
		colNames: [ 'id', '名称', '备注', 'version' ],
		colModel: [ {
			name: 'id',
			width: 50,
			sortable: false
		}, {
			name: 'name',
			width: 100,
			sortable: false
		}, {
			name: 'remark',
			width: 50,
			sortable: false
		}, {
			name: 'version',
			width: 50,
			sortable: false
		} ]
	};
	$( '#list' ).jqGrid( options );

	/** 查询. */
	$( '#queryBtn' ).click( function() {
		$( '#list' ).jqGrid().query( '#queryForm' );
	} );

	/** 新增. */
	$( '#addBtn' ).click( function() {
		window.location.href = '${ctx }/demo/demo-version!input.action';
	} );

	/** 修改. */
	$( '#modifyBtn' ).click( function() {
		var dataId = $( '#list' ).jqGrid( 'getGridParam', 'selrow' );
		if( null != dataId ) {
			window.location.href = '${ctx }/demo/demo-version!input.action?id=' + dataId;
		}
	} );

	/** 删除. */
	$( '#deleteBtn' ).click( function() {
		var dataId = $( '#list' ).jqGrid( 'getGridParam', 'selrow' );
		if( null != dataId ) {
			window.location.href = '${ctx }/demo/demo-version!delete.action?id=' + dataId;
		}
	} );

} );
</script>
</head>

<body>
	<ul class="breadcrumb">
	  <li>Demo Version<span class="divider">/</span></li>
	  <li class="active">查询</li>
	</ul>

	<form id="queryForm" method="post" class="form-horizontal">
		<div>
			<input type="button" id="queryBtn" class="btn btn-primary" value="查询" />
			<input type="button" id="addBtn" class="btn btn-primary" value="新增" />
			<input type="button" id="modifyBtn" class="btn btn-primary" value="修改" />
			<input type="button" id="deleteBtn" class="btn btn-primary" value="删除" />
		</div>
	</form>

	<table id="list"></table>
	<div id="pager"></div>
</body>
</html>